package ar.fiuba.tp7552.buildadmin.webactions.builds;

import java.util.Collection;

import ar.fiuba.tp7552.buildadmin.model.builds.Edificio;
import ar.fiuba.tp7552.buildadmin.service.EdificioService;
import ar.fiuba.tp7552.buildadmin.service.PermissionType;
import ar.fiuba.tp7552.buildadmin.webactions.BaseAction;

public class ListEdificiosAction extends BaseAction {
	
	private EdificioService edificioService;
	private Collection<Edificio> edificios;
	
	// ~~ Constructor ====================================================
	
	public ListEdificiosAction(EdificioService edificioService) {
		super();
		this.edificioService = edificioService;
	}
	
	public String getAll() {
		edificios = edificioService.getAll(PermissionType.ADMIN);
		return BaseAction.SUCCESS;
	}

	// ~~ getters y setters ==============================================
	
	public Collection<Edificio> getEdificios() {
		return edificios;
	}

}
